﻿using DAL.Permission;
using Model.Permission;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL.Permission
{
    public class ModuleBLL
    {
        ModuleDAL dal = new ModuleDAL();

        /// 是否存在该记录
        /// </summary>
        public bool ExistsByType(int typeid)
        {
            return dal.ExistsByType(typeid);
        }

        /// <summary>
        /// 得到当前最大顺序
        /// </summary>
        public int GetCurrentOrder()
        {
            return dal.GetCurrentOrder();
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string ModuleName, int typeid)
        {
            return dal.Exists(ModuleName, typeid);
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int ModuleID, string ModuleName, int typeid)
        {
            return dal.Exists(ModuleID, ModuleName, typeid);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ModuleEntity model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ModuleEntity model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int ModuleID)
        {

            return dal.Delete(ModuleID);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool DeleteList(string ModuleIDlist)
        {
            return dal.DeleteList(ModuleIDlist);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ModuleEntity GetModel(int ModuleID)
        {

            return dal.GetModel(ModuleID);
        }

        /// <summary>
        /// 排序
        /// </summary>
        /// <param name="order"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool UpdateOrder(int order, int id)
        {
            return dal.UpdateOrder(order, id);
        }
    }
}
